package com.数值的整数次方;

public class Solution {

	
	    public double Power(double base, int exponent) {
	    	if(exponent==0) return 1;
	    	if(exponent==1) return exponent;
	    	if(exponent>1) {
	    		double result=base;
	    		for(int i=2;i<=exponent;i++) {
	    			result=result*base;
	    		}
	    		return result;
	    	}
	    	if(exponent<0) {
	    		double result=1;
	    		for(int i=1;i<=(-exponent);i++) {
	    			result=result*base;
	    		}
	    		return 1/result;
	    	}
			return exponent;
	        
	  }
	

}
